//
//  SaveTableViewCell.m
//  B段项目
//
//  Created by dllo on 15/9/29.
//  Copyright (c) 2015年 昶博. All rights reserved.
//

#import "SaveTableViewCell.h"
#import "PrefixHeader.pch"
#import "CollcetModel.h"
#import <UIImageView+WebCache.h>
@implementation SaveTableViewCell

//初始化
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //新闻图片初始化
        self.newsImage = [[UIImageView alloc] init];
        //新闻标题初始化
        self.newsLabel = [[UILabel alloc] init];
        self.newsLabel.font = [UIFont systemFontOfSize:15];
        self.newsLabel.numberOfLines = 0;

        
        [self.contentView addSubview:self.newsImage];
        [self.contentView addSubview:self.newsLabel];
        
    }
    return self;
}

//布局子视图
- (void)layoutSubviews
{
    [super layoutSubviews];
    //新闻图片
    self.newsImage.frame = CGRectMake(ScreenWidth * 5 / 375, ScreenHeight * 5 / 667, ScreenWidth * 110 / 375, ScreenHeight * 90 / 667);
    //新闻标题
    self.newsLabel.frame = CGRectMake(ScreenWidth * 125 / 375, ScreenHeight * 5 / 667, ScreenWidth * 240 / 375, ScreenHeight * 45 / 667);
    
}

- (void)setCollectModel:(CollcetModel *)collectModel
{
    self.newsLabel.text = collectModel.title;
    [self.newsImage sd_setImageWithURL:[NSURL URLWithString:collectModel.newsImage] placeholderImage:[UIImage imageNamed:@"zhanwei.png"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
